import { defineStore } from "pinia";

interface Patient {
  name: string;
  id: string;
}

export const patientStore = defineStore("patient", {
  //数据仓库
  state: () => ({
    patient: {} as Patient,
  }),
  //异步操作方法
  actions: {
    addPatient(patient: Patient) {
      console.log("pinia接收的就诊人：", patient);
      this.patient = patient;
    },
  },
  //类似于computed
  getters: {},
});
